#include <string.h>
#include <stdio.h>

// 正三角
void star1()
{
  int outer;
  int inner;

  for (outer = 1; outer < 10; outer++) {
    for (inner = 1; inner <= outer; inner++)
      printf("%c ", '*');
    
    printf("\n");
  }
}

// 倒三角
void star2()
{
  int i, j;

  for (i = 9; i >= 1; i--) {
    for (j = 1; j <= i; j++)
      printf("%c ", '*');

    printf("\n");
  }
}

// 左三角
void star3()
{
  int outer, inner;

  for (outer = -4; outer <= 4; outer++) {
    for (inner = 1; inner <= (5 - abs(outer)); inner++)
      printf("*");

    for (; inner <= 5; inner++)
      printf(" ");

    printf("\n");
  }
}

// 右三角
void star4()
{
  int outer, inner;

  for (outer = -4; outer <= 4; outer++) {
    for (inner = 1; inner <= abs(outer); inner++)
      printf(" ");

    for (; inner <= 5; inner++)
      printf("*");

    printf("\n");
  }
}

// 垂直菱形
void star5()
{
  int outer;
  int inner;

  for (outer = -4; outer <= 4; outer++) {
    for (inner = -4; inner <= abs(outer) - 5; inner++)
      printf(" ");

    for (; inner <= 5 - abs(outer); inner++)
      printf("*");

    printf("\n");
  }
}

// 水平菱形
void star6()
{
  int outer, inner;

  for (outer = -9; outer <= 0; outer++) {
    for (inner = outer; inner < 0; inner++)
      printf(" ");

    for (; inner <= 9; inner++)
      printf("*");

    printf("\n");
  }
}

// 倒三角形
void star7()
{
  int outer, inner;
  
  for (outer = 1; outer < 10; outer++) {
    for (inner = 1; inner <= outer; inner++)
      printf("%3d ", outer * inner);

    printf("\n");
  }
}

void main()
{
  star1();printf("\n");
  star2();printf("\n");
  star3();printf("\n");
  star4();printf("\n");
  star5();printf("\n");
  star6();printf("\n");
  star7();printf("\n");
}


